<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title> 后台管理 </title>
  <!-- 依 赖 样 式 -->
  <link rel="stylesheet" href="/static/layui/css/layui.css" />
  <link rel="stylesheet" href="/static/ui/css/ui.css" />
  <!-- 加 载 样 式 -->
  <link rel="stylesheet" href="/static/ui/admin/css/loader.css" />
  <!-- 布 局 样 式 -->
  <link rel="stylesheet" href="/static/ui/admin/css/admin.css" />
  <style>
    .notice-item{
      height : 48px;
      display: block;
      padding:10px 5px 10px 20px;
    }
    .notice-item .title{
      width: 96%;
      line-height: 28px;
      display: block;
      font-size: 14px;
      overflow: hidden;
    }
    .notice-item time{
      line-height: 20px;
      font-size: 12px;
      display: block;
    }
  </style>
</head>
<!-- 结 构 代 码 -->

<body class="layui-layout-body pear-admin">
  <!-- 布 局 框 架 -->
  <div class="layui-layout layui-layout-admin">
    <!-- 顶 部 样 式 -->
    <div class="layui-header">
      <!-- 菜 单 顶 部 -->
      <div class="layui-logo">
        <img class="logo"></img>
        <span class="title"></span>
      </div>
      <!-- 顶 部 左 侧 功 能 -->
      <ul class="layui-nav layui-layout-left">
        <li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
        <li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" loading=600></a></li>
      </ul>
      <!-- 多 系 统 菜 单 -->
      <div id="control" class="layui-layout-control"></div>
      <!-- 顶 部 右 侧 菜 单 -->
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a>
        </li>
        <!--li class="layui-nav-item layui-hide-xs"><a href="#" class="layui-icon layui-icon-util" id="toolsTip"></a></li-->
        <!-- 主 题 配 置 -->
        <li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-template"></a></li>
        <!--li class="layui-nav-item layui-hide-xs"><a href="#" class="layui-icon layui-icon-release" id="changeTheme"></a>
        </li-->
        <li class="layui-nav-item layui-hide-xs message"></li>
        <li class="layui-nav-item layui-hide-xs user">
          <a href="#" class="layui-icon layui-icon-username" id="changepwd"></a>
        </li>
        <li class="layui-nav-item layui-hide-xs logout">
          <a href="#" class="layui-icon layui-icon-logout"
            id="loginout"></a>
        </li>
        <!--li class="layui-nav-item layui-hide-xs message"></li-->
        <!--li class="layui-nav-item user">
						<a class="layui-icon layui-icon-username" href="javascript:;"></a>
						<dl class="layui-nav-child">
							<dd><a user-menu-url="view/system/person.html" user-menu-id="5555" user-menu-title="基本资料">基本资料</a></dd>
							<dd><a href="javascript:void(0);" class="logout">注销登录</a></dd>
						</dl>
					</li-->

      </ul>
    </div>
    <!-- 侧 边 区 域 -->
    <div class="layui-side layui-bg-black">
      <!-- 菜 单 顶 部 -->
      <!--div class="layui-logo">
        <img class="logo"></img>
        <span class="title"></span>
      </div-->
      <!-- 菜 单 内 容 -->
      <div class="layui-side-scroll">
        <div id="sideMenu"></div>
      </div>
    </div>
    <!-- 视 图 页 面 -->
    <div class="layui-body">
      <!-- 内 容 页 面 -->
      <div id="content"></div>
    </div>
    <!-- 遮 盖 层 -->
    <div class="pear-cover"></div>
    <!-- 加 载 动 画 -->
    <div class="loader-main">
      <!-- 动 画 对 象 -->
      <div class="loader"></div>
    </div>
  </div>
  <!-- 移 动 端 便 捷 操 作 -->
  <div class="pear-collasped-pe collaspe">
    <a href="#" class="layui-icon layui-icon-shrink-right"></a>
  </div>
  <!-- 依 赖 脚 本 -->
  <script src="/res/group/config.js"></script>
  <script src="/static/layui/layui.js"></script>
  <script src="/static/ui/ui.js"></script>

  <!-- 框 架 初 始 化 -->
  <script>
    layui.use(['admin', 'jquery', 'popup', 'layer'], function () {
      let $ = layui.jquery,
        admin = layui.admin,
        popup = layui.popup,
        layer = layui.layer;
      let setting = {
        "logo": {
          "title": "GodoOA",
          "image": "/static/logo.png"
        },
        "menu": {
          //"data": {{ menus | safe }},
          "collaspe": false,
          "accordion": true,
          "method": "GET",
          "control": true,
          "select": "0"
        },
        "tab": {
          "muiltTab": true,
          "enable": true,
          "keepState": true,
          "tabMax": 30,
          "index": {
            "id": "0",
            "href": "./welcome.html",
            "title": "首页"
          }
        },
        "theme": {
          "defaultColor": "3",
          "defaultMenu": "light-theme",
          "allowCustom": true
        },
        "colors": [
          {
            "id": "1",
            "color": "#2d8cf0"
          },
          {
            "id": "2",
            "color": "#5FB878"
          },
          {
            "id": "3",
            "color": "#1E9FFF"
          },
          {
            "id": "4",
            "color": "#FFB800"
          },
          {
            "id": "5",
            "color": "darkgray"
          }
        ],
        "links": [
          {
            "icon": "layui-icon layui-icon-auz",
            "title": "官方网站",
            "href": "http://godo.im"
          }
        ],
        "other": {
          "keepLoad": 1200,
          "autoHead": true
        },
        "header": {
          "message": "index/msg"
        }
      };
      _get(layui, 'menu/list', res => {
        setting.menu.data = res
        //console.log(res)
        admin.render(setting);
        admin.message(function(id, title, context, form) {
          console.log(id)
        });
      })
      
    // $('#toolsTip').click(e => {
    //   layer.open({
    //     type: 2,
    //     title: '工具集',
    //     shade: 0.1,
    //     offset: 'rt',
    //     area: ['80%', '100%'],
    //     anim: 1,
    //     content: '/admin/tools/index.html'
    //   });
    // });
    // $('#changeTheme').click(e => {
    //   location.href = "/admin";
    // })
    // 登出逻辑 
    admin.logout(function () {
      layer.confirm('确定要退出系统吗', { icon: 3, title: '提示' }, function (index) {
        layer.close(index);
        _get(layui, 'index/loginOut', res => {
          loginOutToken();
          popup.success("退出成功", function () {
            location.href = "./login.html";
          })
        })
      });


      // 注销逻辑 返回 true / false
      return true;
    })

				// 初始化消息回调
		//admin.message();
		
    $('#changepwd').click(e => {
      layer.open({
        type: 2,
        title: '修改密码',
        shadeClose: true,
        shade: 0.8,
        shadeClose: true, // 点击遮罩区域，关闭弹层
        maxmin: true, // 允许全屏最小化
        anim: 0, // 0-6 的动画形式，-1 不开启
        area: ['500px', '300px'],
        content: '/res/group/user/changepwd.html' // iframe 的 url
      });
    })
				
	})
  </script>
</body>

</html>